<?php
namespace Admin\Controller;

class RecycleController extends OrderController{
    public function add(){
		
	}
	
    public function multi(){
    }
    
    public function recycle(){
		
    }
    
    public function recover(){
		if (I('get.id')){
			$Order = D('Order');
			if (!$Order->one()) $this->failed('不存在此订单，或没有此订单的管理权限！');
			$Order->recover() ? $this->success(C('PREV_URL'),'订单还原成功！') : $this->failed('订单还原失败！');
    	}else{
    		$this->failed('非法操作！');
    	}
    }
    
    public function delete(){
		if (I('get.id')){
			$Order = D('Order');
			if (IS_POST) $Order->remove() ? $this->success(I('post.prev'),'订单删除成功！') : $this->failed('订单删除失败！');
			if (!$Order->one()) $this->failed('不存在此订单，或没有此订单的管理权限！');
    		$this->confirm('您真的要删除这条数据么？');
    	}else{
    		$this->failed('非法操作！');
    	}
    }
}